Skip to content

[Frontend] Generic Sortable Data Table Component#310

Open
armorbreak001 wants to merge 1 commit intoGalactiGuild:mainfrom
armorbreak001:bounty/273-data-table
Open

[Frontend] Generic Sortable Data Table Component#310
armorbreak001 wants to merge 1 commit intoGalactiGuild:mainfrom
armorbreak001:bounty/273-data-table

Conversation

@armorbreak001
Copy link
Copy Markdown

Fixes #273

Changes

  • DataTable.tsx: New generic, reusable <DataTable data={[]} columns={[]} /> component
    • Uses @tanstack/react-table v8 (headless — logic hooks only, custom rendering)
    • Column sorting: Click any header to toggle asc → desc → none; sort indicator arrow shown
    • Empty state: Sleek glassmorphism-styled "No Data Available" message when data array is empty
    • Styling: Tailwind CSS matching existing dark theme (stellar-navy, stellar-lightNavy, violet-400 accents)
    • Zebra striping: Alternating row backgrounds for readability
  • package.json: Added @tanstack/react-table dependency
  • index.ts: Exported DataTable from components/ui barrel file

Acceptance Criteria Met

  • Scaffold a <DataTable data={[]} columns={[]} /> component
  • Implement basic Ascending/Descending column sorting when clicking the column header
  • Build a sleek "No Data Available" state if the data array is empty
  • Integrate Tailwind styling mimicking the glassmorphism dark theme

How to Verify

  1. cd frontend && npm install
  2. Import: import { DataTable } from '@/components/ui'
  3. Define columns with ColumnDef[] and pass data array
  4. Click column headers → sort toggles asc/desc/clear
  5. Pass empty data={[]} → shows styled empty state

- Create DataTable component using @tanstack/react-table v8 (headless)
- Implement Ascending/Descending column sorting on header click
- Build sleek 'No Data Available' empty state with glassmorphism styling
- Integrate Tailwind classes matching existing dark theme (stellar-* colors)
- Export from components/ui/index.ts
- Install @tanstack/react-table dependency

Fixes GalactiGuild#273
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend] Generic Sortable Data Table Component

1 participant